/*
 * 3Beelden.h
 *
 *  Created on: Mar 29, 2012
 *      Author: s147614
 */

#ifndef DRIEBUFFER_H_
#define DRIEBUFFER_H_

#include "Monitor.h"
#include "Buffer.h"

class DrieBuffer: private Monitor {
private:
	Buffer* readp; // P rol: wordt gelezen
	Buffer* prevp; // Q rol: net gevuld/reserve
	Buffer* fillp; // R rol: wordt gevuld
	void switchBuffer(Buffer* & a, Buffer* & b);

	bool readPossible;
	bool isFirstFill;
public:
	DrieBuffer( Buffer * ap, Buffer * bp, Buffer * cp);
	~DrieBuffer();

	Buffer* getReadBuffer(); // consument: welke nu ?
	Buffer* getFillBuffer(); // producent: welke nu ?
};

#endif /* DRIEBUFFER_H_ */
